﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;

namespace DayTimeClient
{
    class CallTimeHandler
    {
        private TcpClient theClient;

        public CallTimeHandler(string host, int port)
        {
            try
            {
                theClient = new TcpClient(host, port);
                Console.WriteLine("Port {0} des Hosts {1} kennt TCP.", port, host);
            }
            catch (Exception e)
            {
                Console.WriteLine("Port {0} des Hosts {1}: {2}", port, host, e.Message);
            }
        }

        public String GetAnswer()
        {
            String answer;
            theClient.
                answer = theClient.GetStream();
                theClient.EndConnect();
                return answer;
        }
    }
}
